<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
    <th:block th:include="include :: header('导演或演员个人信息列表')" />
</head>
<body class="gray-bg">
     <div class="container-div">
        <div class="row">
            <div class="col-sm-12 search-collapse">
                <form id="formId">
                    <div class="select-list">
                        <ul>
                            <li>
                                <label>人物名：</label>
                                <input type="text" name="name"/>
                            </li>
                            <li>
                                <label>英文名：</label>
                                <input type="text" name="enName"/>
                            </li>
                            <li>
                                <label>是否导演：</label>
                                <select name="isDirector" th:with="type=${@dict.getType('dl_true_false')}">
                                    <option value="">所有</option>
                                    <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
                                </select>
                            </li>
                            <li>
                                <label>是否演员：</label>
                                <select name="isActor" th:with="type=${@dict.getType('dl_true_false')}">
                                    <option value="">所有</option>
                                    <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
                                </select>
                            </li>
                            <li>
                                <label>粉丝数：</label>
                                <input type="text" name="fans"/>
                            </li>
                            <li>
                                <label>粉丝名称：</label>
                                <input type="text" name="fansName"/>
                            </li>
                            <li>
                                <label>个人简介：</label>
                                <input type="text" name="intruduce"/>
                            </li>
                            <li>
                                <label>别名：</label>
                                <input type="text" name="alias"/>
                            </li>
                            <li>
                                <label>身高：</label>
                                <input type="text" name="height"/>
                            </li>
                            <li>
                                <label>国籍：</label>
                                <select name="country" th:with="type=${@dict.getType('dl_country_type')}">
                                    <option value="">所有</option>
                                    <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
                                </select>
                            </li>
                            <li>
                                <label>血型：</label>
                                <select name="bloodType" th:with="type=${@dict.getType('dl_blood_type')}">
                                    <option value="">所有</option>
                                    <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
                                </select>
                            </li>
                            <li>
                                <label>出生日期：</label>
                                <input type="text" class="time-input" placeholder="请选择出生日期" name="birthday"/>
                            </li>
                            <li>
                                <label>民族：</label>
                                <select name="nation" th:with="type=${@dict.getType('dl_nation_type')}">
                                    <option value="">所有</option>
                                    <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
                                </select>
                            </li>
                            <li>
                                <label>出生地：</label>
                                <input type="text" name="birthPlace"/>
                            </li>
                            <li>
                                <label>星座：</label>
                                <select name="constellation" th:with="type=${@dict.getType('dl_constellation_type')}">
                                    <option value="">所有</option>
                                    <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
                                </select>
                            </li>
                            <li>
                                <label>毕业学校：</label>
                                <input type="text" name="school"/>
                            </li>
                            <li>
                                <label>性别：</label>
                                <select name="gender" th:with="type=${@dict.getType('dl_gender_type')}">
                                    <option value="">所有</option>
                                    <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
                                </select>
                            </li>
                            <li>
                                <label>经纪公司：</label>
                                <input type="text" name="company"/>
                            </li>
                            <li>
                                <label>累计票房：</label>
                                <input type="text" name="totalMovieProfit"/>
                            </li>
                            <li>
                                <a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>
                                <a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i>&nbsp;重置</a>
                            </li>
                        </ul>
                    </div>
                </form>
            </div>

            <div class="btn-group-sm" id="toolbar" role="group">
                <a class="btn btn-success" onclick="$.operate.add()" shiro:hasPermission="mydy:personinfo:add">
                    <i class="fa fa-plus"></i> 添加
                </a>
                <a class="btn btn-primary single disabled" onclick="$.operate.edit()" shiro:hasPermission="mydy:personinfo:edit">
                    <i class="fa fa-edit"></i> 修改
                </a>
                <a class="btn btn-danger multiple disabled" onclick="$.operate.removeAll()" shiro:hasPermission="mydy:personinfo:remove">
                    <i class="fa fa-remove"></i> 删除
                </a>
                <a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="mydy:personinfo:export">
                    <i class="fa fa-download"></i> 导出
                </a>
            </div>
            <div class="col-sm-12 select-table table-striped">
                <table id="bootstrap-table"></table>
            </div>
        </div>
    </div>
    <th:block th:include="include :: footer" />
    <script th:inline="javascript">
        var editFlag = [[${@permission.hasPermi('mydy:personinfo:edit')}]];
        var removeFlag = [[${@permission.hasPermi('mydy:personinfo:remove')}]];
        var isDirectorDatas = [[${@dict.getType('dl_true_false')}]];
        var isActorDatas = [[${@dict.getType('dl_true_false')}]];
        var countryDatas = [[${@dict.getType('dl_country_type')}]];
        var bloodTypeDatas = [[${@dict.getType('dl_blood_type')}]];
        var nationDatas = [[${@dict.getType('dl_nation_type')}]];
        var constellationDatas = [[${@dict.getType('dl_constellation_type')}]];
        var genderDatas = [[${@dict.getType('dl_gender_type')}]];
        var prefix = ctx + "mydy/personinfo";

        $(function() {
            var options = {
                url: prefix + "/list",
                createUrl: prefix + "/add",
                updateUrl: prefix + "/edit/{id}",
                removeUrl: prefix + "/remove",
                exportUrl: prefix + "/export",
                modalName: "导演或演员个人信息",
                columns: [{
                    checkbox: true
                },
                {
                    field: 'id',
                    title: '主键id',
                    visible: false
                },
                {
                    field: 'name',
                    title: '人物名'
                },
                {
                    field: 'enName',
                    title: '英文名'
                },
                {
                    field: 'isDirector',
                    title: '是否导演',
                    formatter: function(value, row, index) {
                       return $.table.selectDictLabel(isDirectorDatas, value);
                    }
                },
                {
                    field: 'isActor',
                    title: '是否演员',
                    formatter: function(value, row, index) {
                       return $.table.selectDictLabel(isActorDatas, value);
                    }
                },
                {
                    field: 'fans',
                    title: '粉丝数'
                },
                {
                    field: 'fansName',
                    title: '粉丝名称'
                },
                {
                    field: 'intruduce',
                    title: '个人简介'
                },
                {
                    field: 'alias',
                    title: '别名'
                },
                {
                    field: 'height',
                    title: '身高'
                },
                {
                    field: 'country',
                    title: '国籍',
                    formatter: function(value, row, index) {
                       return $.table.selectDictLabel(countryDatas, value);
                    }
                },
                {
                    field: 'bloodType',
                    title: '血型',
                    formatter: function(value, row, index) {
                       return $.table.selectDictLabel(bloodTypeDatas, value);
                    }
                },
                {
                    field: 'birthday',
                    title: '出生日期'
                },
                {
                    field: 'nation',
                    title: '民族',
                    formatter: function(value, row, index) {
                       return $.table.selectDictLabel(nationDatas, value);
                    }
                },
                {
                    field: 'birthPlace',
                    title: '出生地'
                },
                {
                    field: 'constellation',
                    title: '星座',
                    formatter: function(value, row, index) {
                       return $.table.selectDictLabel(constellationDatas, value);
                    }
                },
                {
                    field: 'school',
                    title: '毕业学校'
                },
                {
                    field: 'gender',
                    title: '性别',
                    formatter: function(value, row, index) {
                       return $.table.selectDictLabel(genderDatas, value);
                    }
                },
                {
                    field: 'company',
                    title: '经纪公司'
                },
                {
                    field: 'totalMovieProfit',
                    title: '累计票房'
                },
                {
                    title: '操作',
                    align: 'center',
                    formatter: function(value, row, index) {
                        var actions = [];
                        actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="$.operate.edit(\'' + row.id + '\')"><i class="fa fa-edit"></i>编辑</a> ');
                        actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="javascript:void(0)" onclick="$.operate.remove(\'' + row.id + '\')"><i class="fa fa-remove"></i>删除</a>');
                        return actions.join('');
                    }
                }]
            };
            $.table.init(options);
        });
    </script>
</body>
</html>